%  * Calibrate camera [2592x1944]
%  * Calibrate projector [1024x768]
%  * Calibrate stereo
% 
%  **** Calibration results ****
% 
% Camera Calib: 
%  - reprojection error: 0.819928
%  - K:
% [3486.597883630046, 0, 1298.387216783769;
%   0, 3875.943573309087, 930.2202340699594;
%   0, 0, 1]
%  - kc: [0.1769730743674916, -0.6413079920341588, -0.026247226750387, 0.001545285804795444, 0]
% 
% Projector Calib: 
%  - reprojection error: 0.405213
%  - K:
% [3486.378956639671, 0, 550.1477223619765;
%   0, 3523.27793014461, 344.7126487325629;
%   0, 0, 1]
%  - kc: [0.03042162968101235, 10.08067957731273, -0.04736997132628822, 0.01504592660874691, 0]
% 
% Stereo Calib: 
%  - reprojection error: 0.95767
%  - R:
% [0.999995916794002, 0.001655873269165871, -0.002329051102910253;
%   -0.002387316791894311, 0.9320305446448335, -0.3623718595139392;
%   0.001570704892284031, 0.3623759400577962, 0.9320306920661839]
%  - T:
% [42.23591195729403;
%   346.5805940420644;
%   1225.517915672003]

%%
K = [3486.597883630046, 0, 1298.387216783769;
  0, 3875.943573309087, 930.2202340699594;
  0, 0, 1];
% Kp = [3486.378956639671, 0, 550.1477223619765;
%   0, 3523.27793014461, 344.7126487325629;
%   0, 0, 1];
Kp = [3486.378956639671, 0, 1920/2;
  0, 3523.27793014461, 1080/2;
  0, 0, 1];

R = [0.999995916794002, 0.001655873269165871, -0.002329051102910253;
 -0.002387316791894311, 0.9320305446448335, -0.3623718595139392;
  0.001570704892284031, 0.3623759400577962, 0.9320306920661839];

t = [42.23591195729403;
  346.5805940420644;
  1225.517915672003];

f = Kp*t;
d = [0 -f(3) f(2);
     f(3) 0 -f(1);
     f(2) f(1) 0];
F = d*Kp*R*inv(K)
